package com.example.swimmingpool.config;

import com.example.swimmingpool.interceptor.SwimmingPoolInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Resource
    private SwimmingPoolInterceptor interceptor;


    /**
     * 登录拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor)
                .excludePathPatterns("/login")
                .excludePathPatterns("/upload/avatar")
                .excludePathPatterns("/wx/login");
    }


}
